package com.buba.controller;

import com.buba.mapper.TestMapper;
import entity.Test;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @descriptions: Swagger测试
 * @author:
 * @date: 2022/11/13 19:09
 */
@RestController
public class TestController {
    @Resource
    TestMapper testMapper;

    @GetMapping("holle")
    public String holle(){
        return "holle";
    }

    @PostMapping("holle1")
    public Test holle1(){
        return new Test();
    }

    @ApiOperation("测试接口")
    @PostMapping("holle2")
    public String holle2(@ApiParam("名字") String name){
        return "holle"+name;
    }

    @ApiOperation("测试")
    @PostMapping("holle3")
    public Test holle3(@ApiParam("测试类") Test test){
        return test;
    }

    @ApiOperation("测试test")
    @PostMapping("holle4")
    public List<Test> holle4(){
        List<Test> tests = testMapper.testList();
        return tests;
    }
}
